Skip to content

Add schedule route map with sharing and export improvements#1148

Open
abdulm5 wants to merge 3 commits into
asuc-octo:mainfrom
abdulm5:feature/schedule-route-map
Open

Add schedule route map with sharing and export improvements#1148
abdulm5 wants to merge 3 commits into
asuc-octo:mainfrom
abdulm5:feature/schedule-route-map

Conversation

@abdulm5
Copy link
Copy Markdown

@abdulm5 abdulm5 commented May 28, 2026

  • Adds a new /map page for viewing routes between scheduled class locations
  • Adds a map tab inside the schedule editor
  • Displays class stops, walking route lines, travel time, and distance by day
  • Adds Minimal/Satellite map styles with Berkeley-focused campus labels
  • Adds Google Maps route export from the map
  • Improves schedule sharing with copy/share support and public view handling
  • Adds an export dialog for ICS calendar download and class number copying
  • Adds dev login fallback support for local testing

Testing:

  • npm run type-check --workspace apps/frontend
  • npm run lint --workspace apps/frontend
  • npm test --workspace apps/frontend
  • npm run build --workspace apps/frontend
  • npm run type-check --workspace apps/backend
  • npm run lint --workspace apps/backend
  • npm run build --workspace apps/backend
  • npm run type-check
  • Browser-verified /map empty state and dev login flow

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c23128757

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +707 to +710
locatedStops.filter(
(stop, index, stops) =>
index === 0 ||
!sameCoordinates(stop.coordinates, stops[index - 1].coordinates)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve route legs after same-location stops

When a day has consecutive meetings in the same building followed by a different building (A, A, B), this filter drops the second A from routeStops, so legByStopPair stores the fetched leg under the first A's key. The sidebar later looks up the leg for the actual adjacent pair (second A -> B) and shows "Route unavailable" even though the route was fetched. Keep enough stop identity to map the deduped route segment back to the last same-location stop before the next move.

Useful? React with 👍 / 👎.

Comment on lines +35 to +39
useEffect(() => {
if (selectedScheduleId || availableSchedules.length === 0) return;

const containerRef = useRef<HTMLDivElement | null>(null);
const firstSchedule = availableSchedules[0];
if (firstSchedule) setSearchParams({ schedule: firstSchedule._id });
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recover from stale schedule query ids

If a user opens /map?schedule=<id> with an id that is no longer in their schedules (for example after deletion, sharing a stale URL, or switching dev users), selectedScheduleId is truthy so the effect never falls back to an available schedule. When useReadSchedule returns no schedule, the render path below keeps showing the loading indicator forever instead of selecting a valid schedule or showing an error.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address map route edge cases
(2659cab)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant